home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / util / misc / morecli1.lha / MoreCLI.DOC < prev    next >
Text File  |  1994-04-16  |  5KB  |  150 lines

  1. Presenting MoreCLI 1.2 by El Pedro - A selection of CLI tools.
  2.  
  3. This production comprises some extra CLI commands which should be copied into
  4. your C: directory, and 'rearc', a shell script to demonstrate some of the
  5. trickier ones. The script is useful for recompressing archives.
  6. You require Workbench 2.04 or higher to use these programs. (I do not
  7. normally support 1.3)
  8. Some of these commands were written a while ago. They were written so that I
  9. could automate the repacking of archives, which isn't really possible with
  10. the standard CLI commands.
  11. The commands which print output to stdout are really meant for shell
  12. substitution with the "'". See the example script for details.
  13.  
  14. Here comes a description of the commands:
  15.  
  16.  
  17. AddPart - Template: DIR/A,FILE/A
  18.  
  19. This prints the full pathname produced by joining the directory name and
  20. the filename given, taking notice of ':' and '/':
  21.  
  22. 1> AddPart DH0:Prefs Sound
  23. DH0:Prefs/Sound
  24. 1> AddPart DH0:Prefs/ Sound
  25. DH0:Prefs/Sound
  26. 1> AddPart DH0: Prefs.info
  27. DH0:Prefs.info
  28.  
  29.  
  30. df - Template: DEVICE,COUNT/S
  31.  
  32. A friend challenged me to write a program like C:Info, but instead gave
  33. information in (Mega/Kilo)bytes used instead of blocks. I also added a
  34. feature to do a byte count. This is the resulting program. You require
  35. Kickstart 2.0 or above to use this program.
  36.  
  37. df        - List all which matches mask in dfMask variable.
  38. df #?        - List all devices.
  39. df dh?:        - List all hard drive partitions.
  40. df dh?: count    - List all hard drive partitions, and do a byte count.
  41. df ~(xh?:)    - List all partitions, except XPK'd ones (XPK partitions
  42.           cause space to be counted twice, three times, four...)
  43.  
  44. DF uses the template DEVICE,COUNT/S. DEVICE is a pattern for the devices
  45. to list, and COUNT is a flag to say whether to do a bytecount.
  46. If you do not give a device to list, it will use the pattern in the dfMask
  47. variable - if that variable is not set, then it will use "#?" (all devices)
  48.  
  49. 6.System3.0:> setenv dfMask ([DEF]H|SQ)#?
  50. 6.System3.0:> df
  51. Unit      Size    Full  Used   Free   Status      Name
  52. DH0:      10.1M  83.7%  8.47M  1.64M  Read        System3.0
  53. DH1:      30.0M  67.5%  20.3M  9.75M  Read        Utils
  54. DH2:      10.1M  73.4%  7.43M  2.68M  Read/Write  Work
  55. DH3:      20.0M  94.0%  18.8M  1.20M  Read        XPK
  56. DH4:      25.7M  78.1%  20.0M  5.61M  Read        Incoming
  57. DH5:      22.8M  64.0%  14.6M  8.20M  Read/Write  Temp
  58. Total      118M  75.5%  89.8M  29.1M  10.8M       
  59.                     ^- This value is the amount of
  60.             WRITEABLE disk space. May be useful for a BBS with a
  61.             CD mounted, and you want to know how much space for
  62.             user files there is.
  63.  
  64. If you run DF without IPrefs running, it screws up. This appears to be
  65. a 'feature' of RawDoFmt(). I could fix this, but it would increase the size
  66. of DF somewhat.
  67.  
  68. ExtPart Template: FILE/A
  69.  
  70. This prints the extension part of a filename given. If there is no extension,
  71. then the name itself is returned:
  72.  
  73. 1> ExtPart Disk.info
  74. .info
  75. 1> ExtPart Disk
  76. Disk
  77. 1> ExtPart Archive1.00.lha
  78. .lha
  79.  
  80.  
  81. FilePart - Template: FILE/A
  82.  
  83. This prints the file part of a full pathname.
  84.  
  85. 1> FilePart DH0:Prefs/
  86.  
  87. 1> FilePart DH0:Prefs/Sound
  88. Sound
  89. 1> FilePart DH0:Prefs.info
  90. Prefs.info
  91.  
  92.  
  93. FullPath - Template: FILE/A
  94.  
  95. This expands the filename given into its full pathname. Unlike the other
  96. commands, the file/directory given has to exist. This could be useful for
  97. preserving the case of a filename given to your script.
  98.  
  99. 1> FullPath LOCALE:
  100. System:Locale
  101. 1> FullPath ""
  102. Work:DICE/MoreCLI
  103. 1> FullPath c:dir
  104. System:C/Dir
  105.  
  106.  
  107. Inhibit - DRIVE/A,ON/S,OFF/S
  108.  
  109. C:Lock stops writing to a drive. Inhibit stops reading from a drive. When
  110. you inhibit a drive, it will just appear as DF0:BUSY on Workbench. Very handy
  111. when DMSing lots of files, you know, when you rip a disk out after DMSing it,
  112. and you get the 'You must replace...' requester. After inhibiting the drive,
  113. you will not get the requester.
  114.  
  115. 1> Inhibit DF0: on
  116.     Enables read protection of DF0:
  117. 1> Inhibit DF0: off
  118.     Disables read protection of DF0:
  119. 1> Inhibit DF0: on off
  120.     Equivalent to Diskchange, but sometimes works better (alias it?)
  121.  
  122. Usually Inhibiting nests (it depends what filesystem you use. FFS nests.)
  123. So if you inhibit a drive twice, you have to uninhibit it twice. You can
  124. also unlock a drive which another program has locked.
  125.  
  126.  
  127. PathPart - Template: FILE/A
  128.  
  129. This prints the file part of a full pathname.
  130.  
  131. 1> PathPart DH0:Prefs
  132. DH0:
  133. 1> PathPart DH0:Prefs/Sound
  134. DH0:Prefs
  135. 1> PathPart DH0:Prefs.info
  136. DH0:
  137.  
  138.  
  139. StemPart - Template: FILE/A
  140.  
  141. This prints the stem part of a filename given. If there is no extension,
  142. then the name itself is returned:
  143.  
  144. 1> StemPart Disk.info
  145. Disk
  146. 1> StemPart Disk
  147. Disk
  148. 1> StemPart Archive1.00.lha
  149. Archive1.00
  150.